package com.cu.shardingjdbcmybaties.service.impl;


import com.alibaba.nacos.api.config.annotation.NacosValue;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.cu.shardingjdbcmybaties.entity.User;
import com.cu.shardingjdbcmybaties.mapper.UserMapper;
import com.cu.shardingjdbcmybaties.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * @author Administrator
 * @description 针对表【user】的数据库操作Service实现
 * @createDate 2025-05-12 11:25:39
 */
@Service
public class UserServiceImpl
        implements UserService {

    @Autowired
    UserMapper userMapper;

    @NacosValue(value = "name",autoRefreshed = true)
    private String name;



    @Override
    public void addUser(User user) {
        userMapper.insertUser(user);
    }

    public User queryByName(String name){
        return userMapper.queryByName(name);
    }

    @Override
    public List<User> queryAll() {
        return userMapper.queryAll();
    }

}




